<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="target-densitydpi=640,width=1280,user-scalable=yes">
    <base href="<?php echo $system['siteRoot'];?>" />
    <title>普通商品</title>
    <link rel="SHORTCUT ICON" href="style/images/bitbug_favicon1.ico"/>
    <link rel="BOOKMARK" href="style/images/bitbug_favicon2.ico"/>
    <link rel="stylesheet" href="plugin/reset.css"/>
    <link rel="stylesheet" href="plugin/awesome4/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="style/common.css"/>
    <link rel="stylesheet" href="style/goods-common-use.css">
    <link rel="stylesheet" href="style/sale-information.css">
    <link rel="stylesheet" href="style/goods-detail-use.css">
    <script src="plugin/jquery-1.11.2.min.js"></script>
    <script type="text/javascript">_root='<?php echo $system['siteRoot'];?>'</script>
    <script src="script/api.js"></script>
    <script src="script/tipi.jquery.js"></script>
    <script src="script/rating.jquery.js"></script>
    <script src="script/img.js"></script>
    <script src="script/comment.js"></script>
    <script type="text/javascript">
        var _goodsInfo = {
            id:<?=$r['id']?>,
            gopen_id:<?=$r['gopen_id']?>,
            number:1,
            attr_id:<?=$r['attr'][0]['id']?>,
            stock:<?=$r['attr'][0]['stock']?>,
        }
    </script>
    <script src="script/imgScale.js"></script>
    <script src="plugin/highcharts/highcharts.js"></script>
    <script src="script/goodsDetail.js"></script>
</head>
<body>
<div id="container" class="index">
    <?php import_part("custom.home","userBar"); ?>
    <?php import_part("custom.home","header"); ?>
    <?php import_tpl("fragment/nav.php"); ?>
    <div class="main-container">
        <div class="left">
            <div class="seller-info">
                <h4><?=$r['shop']['company']?></h4>
                <p  class="time">入住时间：<?=date('Y年m月', strtotime($r['shop']['create_time']));?></p>
                <p>资质认证：<i class="fa fa-check-circle"></i>营业执照已认证</p>
                <p class="certification"><i class="fa fa-check-circle"></i>实名已认证</p>
                <p class="certification"><i class="fa fa-check-circle"></i>身份证已认证</p>
                <p>商家地址：</p>
                <p><?=!empty($r['shop']['addressLink'])?$r['shop']['addressLink']:'';?> <?=$r['shop']['address']?></p>
                <img src="http://api.map.baidu.com/staticimage?center=<?=$r['shop']['longitude']?>,<?=$r['shop']['latitude']?>&width=168&height=120&zoom=12" alt="">
            </div>
            <div class="slide">
                <?php foreach ($r['category'] as $k=>$v) {?>
                    <a class="menu-label" href="<?php e_page('goods','category',array('cat_id'=>$v['id'])) ?>"><?=$v['name']?><i class="fa fa-angle-right"></i></a>
                <?php }?>
            </div>
            <div class="qr-code-box">
                <img src="images/weixin.png" alt="扫描二维码关注" title="关注我们的微信"/>
                <div>
                    <p class="weixin">扫描二维码</p>
                    <p class="concern">关注我们的微信</p>
                </div>
            </div>
        </div>
        <div class="right">
            <div class="categro">
                <p>
                    <?php
                    $count=count($r['cat']);
                    foreach ($r['cat'] as $k=>$v) {?>
                        <a href="<?php e_page('goods','category',array('cat_id'=>$v['id'])) ?>"><?=$v['name']?></a><i class="<?=$k < $count-1? 'fa fa-angle-right':'' ?>"></i>
                    <?php }?>
                </p>
            </div>
            <div class="goods-infro-detail">
                <div class="goods-images">
                    <div class="large-img-area">
                        <img class="good-large-img" src="<?=$r['pic'][0]['url']?>" alt=""/>
                    </div>
                    <div class="small-img">
                        <a class="small-img-left"><i class="fa fa-caret-left"></i></a>
                        <div class="small-img-box">
                        <?php foreach ($r['pic'] as $v) {?>
                            <img src="<?=$v['url']?>" alt=""/>
                        <?php }?>
                        </div>
                        <a class="small-img-right"><i class="fa fa-caret-right"></i></a>
                    </div>
                </div>
                <div class="goods-describe">
                    <div class="goods-topic">
                        <h3><?=$r['name']?>
                            <?php foreach ($r['label'] as $k=>$v) {
                                if($v['show_in_detail']){
                                    switch($k%3){
                                        case 0:$class='hot-sell';break;
                                        case 1:$class='quality-goods';break;
                                        case 2:$class='speed-delivery';break;
                                    }?>
                                    <span class="<?=$class?>"><?=$v['name']?></span>
                            <?php }}?>
                           </h3>
                    </div>
                    <div class="goods-description">
                        <div class="price">
                            <p>
                                <?php if(!empty($r['price']['original_price'])){ ?>
                                <span class="former-price">(<?=$r['price']['original_price'] ?>)</span>
                                <?php }?>
                                <em><?=$r['price']['base_price'] ?></em>
                                <?php if(!empty($r['price']['low'])){ ?>
                                <?=$r['price']['low']?><?=$r['unit']?>以下&nbsp;&nbsp;
                                    <?php if(!empty($r['price']['medium'])){ ?>|
                                <span class="present-price">
                                    <em><?=$r['price']['medium_price']?></em>
                                </span><?=$r['price']['low'].'-'.$r['price']['medium']?><?=$r['unit']?>&nbsp;&nbsp;
                                    | <em><?=$r['price']['high_price']?></em><?=$r['price']['medium']?><?=$r['unit']?>以上
                                <?php }}?>
                            </p>
                        </div>
                        <div class="purchase-hint">
                            <p>
                                <span class="purchase-hint-label">购买注意: <?=empty($r['note'])?'请通过商家咨询':$r['note'] ?></span>
                                <span></span>
                            </p>
                        </div>
                        <div class="sale-info">
                            <p class="sale-info-title">产品规格</p>
                            <div class="sale-info-label">
                            <?php foreach ($r['attr'] as $k=>$v) {?>
                                <a class="js-attr <?php if($k==0){echo 'js-attr-selected';}?>" data-id="<?=$v['id']?>" data-stock="<?=$v['stock']?>" href="javascript:"><span><?=$v['name']?></span></a>
                            <?php }?>
                            </div>
                        </div>
                        <div class="sale-amount">                               
                            <span class="sale-amount-title">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量</span>
                            <div class="sale-amount-box">
                                <input class="js-amount" type="text" value="1">                            
                                <div class="sale-amount-control">
                                    <a href="" class="js-amount-control amount-minus">-</a>
                                    <a href="" class="js-amount-control amount-plus">+</a>
                                </div>
                            </div>
                            <span>/<?=$r['unit']?></span>
                            <span class="inventory">（库存<span class="js-stock"><?=$r['attr'][0]['stock']?></span><?=$r['unit']?>）</span>
                        </div>
                        <div class="evaluation">
                            <span>评&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;分</span>
                            <?php for($tempComment=1;$tempComment<=5;$tempComment++){ ?>
                                <?php if($r['score']-$tempComment>=0){ ?>
                                    <i class="fa fa-star"></i>
                                <?php }elseif($r['score']-$tempComment>-1){?>
                                    <i class="fa fa-star-half-o"></i>
                                <?php }else{ ?>
                                    <i class="fa fa-star-o"></i>
                                <?php } ?>
                            <?php } ?>
                        </div>
                    </div>
                    <div class="goods-button">
                        <a class="js-buynow" href="<?php e_page('order','confirmDirect',array('id'=>$r['gopen_id'])) ?>">立即购买</a>
                        <a href="" class="join-cart"><i class="fa fa-shopping-cart"></i>加入购物车</a>
                        <span class="js-collect"><i class="fa fa-star"></i>收藏/分享</span></span>
                    </div>
                </div>
            </div>
            <div class="goods-more-detail">
                <div class="choice-box">
                    <div class="focus"><a href="">产品详情</a></div>
                    <div><a href="">价格趋势</a></div>                    
                    <div><a href="">产品评价</a></div>
                    <div><a href="">供应商详情</a></div>
                    <div><a href="">买家须知</a></div>
                </div>
                <div class="product-detail">
                <?=$r['detail']?>
                </div>
                <div class="choice-box">
                    <div><a href="">产品详情</a></div>
                    <div class="focus"><a href="">价格趋势</a></div>                    
                    <div><a href="">产品评价</a></div>
                    <div><a href="">供应商详情</a></div>
                    <div><a href="">买家须知</a></div>
                </div>
                <div class="price-tendency">
                    <div id="price-tendency"></div>
                </div>
                <div class="choice-box">
                    <div><a href="">产品详情</a></div>
                    <div><a href="">价格趋势</a></div>                    
                    <div class="focus"><a href="">产品评价</a></div>
                    <div><a href="">供应商详情</a></div>
                    <div><a href="">买家须知</a></div>
                </div>
                <div class="evaluation js-evaluation">
                    <div class="eva-box">
                        <div class="eva-photo clearfix">
                            <div class="eva-photo-item"></div>
                        </div>
                        <div class="eva-content"> 
                            <p class="eva-content-words">评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test评价内容test</p>
                            <p class="put-time">2015/03/10 12:12</p>
                        </div>
                        <div class="buyer-name">
                            <p class="js-buyer-name">王**（匿名）</p>
                            <p class="buyer-level">会员Lv5买家</p>
                        </div>
                        <div class="eva-reply">
                            <span>商家回复：</span>
                            <span class="reply-time"></span>
                            <span class="reply-content"></span>
                        </div>
                    </div>
                </div>
                <div class="turn-page">
                    <a class="up"><i class="fa fa-chevron-left"></i>上一页</a>
                    <a class="pagenumber">1</a>
                    <span class="page-more">...</span>
                    <a class="down">下一页<i class="fa fa-chevron-right"></i></a>
                </div>
                <div class="choice-box">
                    <div><a href="">产品详情</a></div>
                    <div><a href="">价格趋势</a></div>                    
                    <div><a href="">产品评价</a></div>
                    <div class="focus"><a href="">供应商详情</a></div>
                    <div><a href="">买家须知</a></div>
                </div>
                <div class="more-detail">
                    <?=$r['supplier']?>
                </div>
                <div class="choice-box">
                    <div><a href="">产品详情</a></div>
                    <div><a href="">价格趋势</a></div>                    
                    <div><a href="">产品评价</a></div>
                    <div><a href="">供应商详情</a></div>
                    <div class="focus"><a href="">买家须知</a></div>
                </div>
                <div class="more-detail">
                    <?=$r['tip_content']?>
                </div>
            </div>
        </div>
    </div>
    <div class="QQ-insult">
        <i class="fa fa-qq"></i>
        <a href="http://wpa.qq.com/msgrd?v=3&uin=<?=empty($r['qq'])?$r['shop']['qq']:$r['qq']; ?>&site=qq&menu=yes" target="_blank">客服咨询</a>
    </div>
    <?php import_tpl("fragment/footer.php"); ?>
</div>
</body>
</html>